/*
 * @Author: 张俊辉 zhangjunhui@mangocosmos.com
 * @Date: 2023-11-20 16:20:09
 * @LastEditors: 张俊辉 zhangjunhui@mangocosmos.com
 * @LastEditTime: 2023-11-20 17:02:58
 * @FilePath: \npm-packaging\src\components\common\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import BaseSearch from './searchCustom/index.vue'
import TableCustom from './tableCustom/index.vue'


let plugins={};
const componentArray=[BaseSearch,TableCustom]

plugins.install=function (Vue) {
    // 判断是否安装过
    if(plugins.installed) return;
    plugins.installed=true
   console.log('plugins.installed==========',plugins.installed)
    // 获取地址栏特定搜索串内容
    // Vue.prototype.$getSearchParam=function(name){
    //     const reg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`, 'i');
    //     const r = window.location.search.substr(1).match(reg);
    //     if (r != null) {
    //         return decodeURIComponent(r[2]);
    //     }
    //     return '';
    // }

    componentArray.forEach((item)=>{
        Vue.component(item.name,item)
    })

}
// /* 支持使用标签的方式引入 */
// if (typeof window !== 'undefined' && window.Vue) {
//     install(window.Vue);
// }


export default plugins